package com.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author hdu_huang
 * @since 2024/7/25 14:44
 * desc   测试mybatis-plus
 */

@Data
@Accessors(chain = true, fluent = false, prefix = {}) //fluent id(), name()
@TableName("user_info")
public class UserInfo {

    @TableId(value = "id", type = IdType.AUTO)
    @TableField(insertStrategy = FieldStrategy.NEVER)  //bug? 无效果
    private Integer id;

    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private Date createTime;
    private Date modifyTime;

    @TableField(value = "name", select = true)
    private String name;
    private Integer age;

    //@TableField(fill = FieldFill.INSERT_UPDATE)
    private String birthday;

    @TableField(exist = false)
    private String email;

    //@TableField(typeHandler = JacksonTypeHandler.class)
    //private User user;

    /**
     * 逻辑删除（0:未删除, 1:已删除）TableLogic会在查询条件上添加 AND is_deleted=0
     */
    @TableLogic
    private Integer isDeleted;

    @TableField(exist = false)
    private String remark;

}
